unit uDataTransferObject;

interface

uses
  Classes, SysUtils, TypInfo, uMPropList;

type

  MyIndex = record
    Index: array of string;
  end;

type

  TDataTransferObject = class(TPersistent)
  private
    PropList: TMPropList;
    tb: string;
  public
    GridInfo: array of string;
    GridVisible: TStringList;
    isDetail: Boolean;
    IndexInfo: string;
    procedure SetIndexInfo(t1Key, t2Key: string; dt1, dt2: TDataTransferObject);

    property tbName: string read tb write tb;
    property FPropList: TMPropList read PropList write PropList;
    constructor Create;
    procedure InitPropList;
    destructor Destroy; override;
  end;

implementation

constructor TDataTransferObject.Create;
begin
  PropList := TMPropList.Create(Self);
  GridVisible := TStringList.Create;
  isDetail := false;
  inherited Create;
end;

procedure TDataTransferObject.InitPropList;
begin
  PropList := TMPropList.Create(Self);
end;

procedure TDataTransferObject.SetIndexInfo(t1Key, t2Key: string; dt1, dt2: TDataTransferObject);
begin
  IndexInfo := dt1.tbName + '.' + t1Key + '=' + dt2.tbName + '.' + t2Key;
end;

destructor TDataTransferObject.Destroy;
begin
  PropList.Free;
  inherited Destroy;
end;

end.
